home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************/
- /*
- /* serial.close.dll.c
- /* by Atul Butte
- /* Copyright © 1989 by Microsoft Corporation
- /* All Rights Reserved
- /*
- /* version 1.0
- /*
- /*
- /* This CALL/REGISTER closes a serial port.
- /*
- /* Excel usage:
- /*
- /* = Register( "serial library", "serial.close", "IH" )
- /* = Call( ref, portNumber )
- /*
- /* where
- /* portNumber = number of port (1 = modem, 2 = printer)
- /*
- /***********************************************************************/
-
- /***********************************************************************/
- /*
- /* D E F I N E S
- /*
- /***********************************************************************/
-
- #define ROUTINE_NAME "serial.close"
- #define hNIL 0L
- #define pNIL 0L
-
- /***********************************************************************/
- /*
- /* I N C L U D E S
- /*
- /***********************************************************************/
-
- #include "serial.h"
- #include "error.h"
-
- /***********************************************************************/
- /*
- /* main
- /*
- /***********************************************************************/
-
- pascal short main( port )
-
- unsigned short port; /* serial port to use */
- {
- RememberA0( );
- SetUpA4( );
-
- if( port == 1 ) {
- port = sPortA;
- } else if( port == 2 ) {
- port = sPortB;
- } else {
- display_error( "Illegal port number." );
- RestoreA4( );
- return( errInvalidPort );
- }
-
- RamSDClose( port );
- RestoreA4( );
- return( noErr );
- }